package com.sec.bnjey.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DiagDbHelper extends SQLiteOpenHelper {

	static final String DATABASE_NAME = "diagnosis.db";
	static final int DATABASE_VERSION = 1;

	public DiagDbHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(DiagDbUtil.CREATE_QUERY);
		db.execSQL(DiagHistoryDbUtil.CREATE_QUERY);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS " + DiagDbUtil.DATABASE_TABLE);
		db.execSQL("DROP TABLE IF EXISTS " + DiagHistoryDbUtil.DATABASE_TABLE);
		onCreate(db);
	}

}
